package structural.decorator.custom.condiment;

import structural.decorator.custom.Coffee;
import structural.decorator.custom.Condiment;

/**
 * 装饰：调料-抹茶
 */
public class Mocha implements Condiment {
    Coffee coffee;

    public Mocha(Coffee coffee) {
        this.coffee = coffee;
    }

    @Override
    public String getDescription() { // 装饰1 增加内容
        return coffee.getDescription() + ", 抹茶";
    }

    @Override
    public double cost() {
        return coffee.cost() + .2; // 装饰2 价格累加
    }
}
